<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/xhtml;charset=UTF-8"/>
<title>QxOrm: C:/Dvlp/_Perso/QxOrm/include/QxDao/IxPersistable.h Source File</title>

<link href="tabs.css" rel="stylesheet" type="text/css"/>
<link href="doxygen.css" rel="stylesheet" type="text/css" />
<link href="navtree.css" rel="stylesheet" type="text/css"/>
<script type="text/javascript" src="jquery.js"></script>
<script type="text/javascript" src="resize.js"></script>
<script type="text/javascript" src="navtree.js"></script>
<script type="text/javascript">
  $(document).ready(initResizable);
</script>
<link href="search/search.css" rel="stylesheet" type="text/css"/>
<script type="text/javascript" src="search/search.js"></script>
<script type="text/javascript">
  $(document).ready(function() { searchBox.OnSelectItem(0); });
</script>

</head>
<body>
<div id="top"><!-- do not remove this div! -->


<div id="titlearea">
<table cellspacing="0" cellpadding="0">
 <tbody>
 <tr style="height: 56px;">
  
  <td id="projectlogo"><img alt="Logo" src="logo_qxorm.png"/></td>
  
  
  <td style="padding-left: 0.5em;">
   <div id="projectname">QxOrm
   &#160;<span id="projectnumber">1.4.3</span>
   </div>
   <div id="projectbrief">C++ Object Relational Mapping library</div>
  </td>
  
  
  
 </tr>
 </tbody>
</table>
</div>

<!-- Generated by Doxygen 1.7.5.1 -->
<script type="text/javascript">
var searchBox = new SearchBox("searchBox", "search",false,'Search');
</script>
  <div id="navrow1" class="tabs">
    <ul class="tablist">
      <li><a href="index.html"><span>Main&#160;Page</span></a></li>
      <li><a href="modules.html"><span>Modules</span></a></li>
      <li><a href="namespaces.html"><span>Namespaces</span></a></li>
      <li><a href="annotated.html"><span>Classes</span></a></li>
      <li class="current"><a href="files.html"><span>Files</span></a></li>
      <li><a href="dirs.html"><span>Directories</span></a></li>
      <li>
        <div id="MSearchBox" class="MSearchBoxInactive">
        <span class="left">
          <img id="MSearchSelect" src="search/mag_sel.png"
               onmouseover="return searchBox.OnSearchSelectShow()"
               onmouseout="return searchBox.OnSearchSelectHide()"
               alt=""/>
          <input type="text" id="MSearchField" value="Search" accesskey="S"
               onfocus="searchBox.OnSearchFieldFocus(true)" 
               onblur="searchBox.OnSearchFieldFocus(false)" 
               onkeyup="searchBox.OnSearchFieldChange(event)"/>
          </span><span class="right">
            <a id="MSearchClose" href="javascript:searchBox.CloseResultsWindow()"><img id="MSearchCloseImg" border="0" src="search/close.png" alt=""/></a>
          </span>
        </div>
      </li>
    </ul>
  </div>
  <div id="navrow2" class="tabs2">
    <ul class="tablist">
      <li><a href="files.html"><span>File&#160;List</span></a></li>
      <li><a href="globals.html"><span>File&#160;Members</span></a></li>
    </ul>
  </div>
</div>
<div id="side-nav" class="ui-resizable side-nav-resizable">
  <div id="nav-tree">
    <div id="nav-tree-contents">
    </div>
  </div>
  <div id="splitbar" style="-moz-user-select:none;" 
       class="ui-resizable-handle">
  </div>
</div>
<script type="text/javascript">
  initNavTree('_ix_persistable_8h.html','');
</script>
<div id="doc-content">
<div class="header">
  <div class="headertitle">
<div class="title">IxPersistable.h</div>  </div>
</div>
<div class="contents">
<a href="_ix_persistable_8h.html">Go to the documentation of this file.</a><div class="fragment"><pre class="fragment"><a name="l00001"></a>00001 <span class="comment">/****************************************************************************</span>
<a name="l00002"></a>00002 <span class="comment">**</span>
<a name="l00003"></a>00003 <span class="comment">** http://www.qxorm.com/</span>
<a name="l00004"></a>00004 <span class="comment">** Copyright (C) 2013 Lionel Marty (contact@qxorm.com)</span>
<a name="l00005"></a>00005 <span class="comment">**</span>
<a name="l00006"></a>00006 <span class="comment">** This file is part of the QxOrm library</span>
<a name="l00007"></a>00007 <span class="comment">**</span>
<a name="l00008"></a>00008 <span class="comment">** This software is provided &#39;as-is&#39;, without any express or implied</span>
<a name="l00009"></a>00009 <span class="comment">** warranty. In no event will the authors be held liable for any</span>
<a name="l00010"></a>00010 <span class="comment">** damages arising from the use of this software</span>
<a name="l00011"></a>00011 <span class="comment">**</span>
<a name="l00012"></a>00012 <span class="comment">** Commercial Usage</span>
<a name="l00013"></a>00013 <span class="comment">** Licensees holding valid commercial QxOrm licenses may use this file in</span>
<a name="l00014"></a>00014 <span class="comment">** accordance with the commercial license agreement provided with the</span>
<a name="l00015"></a>00015 <span class="comment">** Software or, alternatively, in accordance with the terms contained in</span>
<a name="l00016"></a>00016 <span class="comment">** a written agreement between you and Lionel Marty</span>
<a name="l00017"></a>00017 <span class="comment">**</span>
<a name="l00018"></a>00018 <span class="comment">** GNU General Public License Usage</span>
<a name="l00019"></a>00019 <span class="comment">** Alternatively, this file may be used under the terms of the GNU</span>
<a name="l00020"></a>00020 <span class="comment">** General Public License version 3.0 as published by the Free Software</span>
<a name="l00021"></a>00021 <span class="comment">** Foundation and appearing in the file &#39;license.gpl3.txt&#39; included in the</span>
<a name="l00022"></a>00022 <span class="comment">** packaging of this file. Please review the following information to</span>
<a name="l00023"></a>00023 <span class="comment">** ensure the GNU General Public License version 3.0 requirements will be</span>
<a name="l00024"></a>00024 <span class="comment">** met : http://www.gnu.org/copyleft/gpl.html</span>
<a name="l00025"></a>00025 <span class="comment">**</span>
<a name="l00026"></a>00026 <span class="comment">** If you are unsure which license is appropriate for your use, or</span>
<a name="l00027"></a>00027 <span class="comment">** if you have questions regarding the use of this file, please contact :</span>
<a name="l00028"></a>00028 <span class="comment">** contact@qxorm.com</span>
<a name="l00029"></a>00029 <span class="comment">**</span>
<a name="l00030"></a>00030 <span class="comment">****************************************************************************/</span>
<a name="l00031"></a>00031 
<a name="l00032"></a>00032 <span class="preprocessor">#ifndef _IX_PERSISTABLE_H_</span>
<a name="l00033"></a>00033 <span class="preprocessor"></span><span class="preprocessor">#define _IX_PERSISTABLE_H_</span>
<a name="l00034"></a>00034 <span class="preprocessor"></span>
<a name="l00035"></a>00035 <span class="preprocessor">#ifdef _MSC_VER</span>
<a name="l00036"></a>00036 <span class="preprocessor"></span><span class="preprocessor">#pragma once</span>
<a name="l00037"></a>00037 <span class="preprocessor"></span><span class="preprocessor">#endif</span>
<a name="l00038"></a>00038 <span class="preprocessor"></span>
<a name="l00046"></a>00046 <span class="preprocessor">#include &lt;boost/type_traits/is_base_of.hpp&gt;</span>
<a name="l00047"></a>00047 
<a name="l00048"></a>00048 <span class="preprocessor">#include &lt;<a class="code" href="_qx_sql_query_8h.html" title="Define a user SQL query added to default SQL query builded by QxOrm library, and used by qx::dao::xxx...">QxDao/QxSqlQuery.h</a>&gt;</span>
<a name="l00049"></a>00049 <span class="preprocessor">#include &lt;<a class="code" href="_qx_dao_8h.html" title="Provide template functions to map C++ class registered into QxOrm context with table database (ORM - ...">QxDao/QxDao.h</a>&gt;</span>
<a name="l00050"></a>00050 
<a name="l00051"></a>00051 <span class="preprocessor">#include &lt;<a class="code" href="_qx_class_8h.html" title="Concrete class registered into QxOrm context.">QxRegister/QxClass.h</a>&gt;</span>
<a name="l00052"></a>00052 
<a name="l00053"></a>00053 <span class="preprocessor">#include &lt;<a class="code" href="_qx_collection_8h.html" title="QxOrm container (keep insertion order + quick access by index + quick access by key)">QxCollection/QxCollection.h</a>&gt;</span>
<a name="l00054"></a>00054 
<a name="l00055"></a>00055 <span class="preprocessor">#include &lt;<a class="code" href="get__primary__key_8h.html" title="qx::trait::get_primary_key&lt;T&gt;::type : return primary key type of T, by default primary key is long ty...">QxTraits/get_primary_key.h</a>&gt;</span>
<a name="l00056"></a>00056 
<a name="l00057"></a>00057 <span class="preprocessor">#include &lt;<a class="code" href="_qx_invalid_value_x_8h.html" title="List of invalid values.">QxValidator/QxInvalidValueX.h</a>&gt;</span>
<a name="l00058"></a>00058 <span class="preprocessor">#include &lt;<a class="code" href="_qx_validator_fct_8h.html" title="Implementation of qx::validate&lt;T&gt;() function (validator engine)">QxValidator/QxValidatorFct.h</a>&gt;</span>
<a name="l00059"></a>00059 
<a name="l00060"></a>00060 <span class="keyword">namespace </span>qx {
<a name="l00061"></a>00061 
<a name="l00080"></a><a class="code" href="classqx_1_1_ix_persistable.html">00080</a> <span class="keyword">class </span><a class="code" href="_qx_macro_8h.html#aa569abe24f343fdc4ad5e12e156ba8a2">QX_DLL_EXPORT</a> <a class="code" href="classqx_1_1_ix_persistable.html" title="qx::IxPersistable : common interface (abstract class) for persistents classes using QX_PERSISTABLE_HP...">IxPersistable</a>
<a name="l00081"></a>00081 {
<a name="l00082"></a>00082 
<a name="l00083"></a>00083 <span class="keyword">public</span>:
<a name="l00084"></a>00084 
<a name="l00085"></a>00085    <a class="code" href="classqx_1_1_ix_persistable.html" title="qx::IxPersistable : common interface (abstract class) for persistents classes using QX_PERSISTABLE_HP...">IxPersistable</a>();
<a name="l00086"></a>00086    <span class="keyword">virtual</span> ~<a class="code" href="classqx_1_1_ix_persistable.html" title="qx::IxPersistable : common interface (abstract class) for persistents classes using QX_PERSISTABLE_HP...">IxPersistable</a>();
<a name="l00087"></a>00087 
<a name="l00097"></a>00097    <span class="keyword">virtual</span> <span class="keywordtype">long</span> qxCount(<span class="keyword">const</span> <a class="code" href="classqx_1_1_qx_sql_query.html" title="qx::QxSqlQuery : define a user SQL query added to default SQL query builded by QxOrm library...">qx::QxSqlQuery</a> &amp; query = <a class="code" href="classqx_1_1_qx_sql_query.html" title="qx::QxSqlQuery : define a user SQL query added to default SQL query builded by QxOrm library...">qx::QxSqlQuery</a>(), QSqlDatabase * pDatabase = NULL) = 0;
<a name="l00098"></a>00098 
<a name="l00109"></a>00109    <span class="keyword">virtual</span> QSqlError qxCount(<span class="keywordtype">long</span> &amp; lCount, <span class="keyword">const</span> <a class="code" href="classqx_1_1_qx_sql_query.html" title="qx::QxSqlQuery : define a user SQL query added to default SQL query builded by QxOrm library...">qx::QxSqlQuery</a> &amp; query = <a class="code" href="classqx_1_1_qx_sql_query.html" title="qx::QxSqlQuery : define a user SQL query added to default SQL query builded by QxOrm library...">qx::QxSqlQuery</a>(), QSqlDatabase * pDatabase = NULL) = 0;
<a name="l00110"></a>00110 
<a name="l00123"></a>00123    <span class="keyword">virtual</span> QSqlError qxFetchById(<span class="keyword">const</span> QVariant &amp; <span class="keywordtype">id</span> = QVariant(), <span class="keyword">const</span> QStringList &amp; columns = QStringList(), <span class="keyword">const</span> QStringList &amp; relation = QStringList(), QSqlDatabase * pDatabase = NULL) = 0;
<a name="l00124"></a>00124 
<a name="l00138"></a>00138    <span class="keyword">virtual</span> QSqlError qxFetchAll(<a class="code" href="classqx_1_1_ix_collection.html" title="qx::IxCollection : common interface for all QxOrm containers qx::QxCollection&lt;Key, Value&gt;">qx::IxCollection</a> &amp; list, <span class="keyword">const</span> QStringList &amp; columns = QStringList(), <span class="keyword">const</span> QStringList &amp; relation = QStringList(), QSqlDatabase * pDatabase = NULL) = 0;
<a name="l00139"></a>00139 
<a name="l00154"></a>00154    <span class="keyword">virtual</span> QSqlError qxFetchByQuery(<span class="keyword">const</span> <a class="code" href="classqx_1_1_qx_sql_query.html" title="qx::QxSqlQuery : define a user SQL query added to default SQL query builded by QxOrm library...">qx::QxSqlQuery</a> &amp; query, <a class="code" href="classqx_1_1_ix_collection.html" title="qx::IxCollection : common interface for all QxOrm containers qx::QxCollection&lt;Key, Value&gt;">qx::IxCollection</a> &amp; list, <span class="keyword">const</span> QStringList &amp; columns = QStringList(), <span class="keyword">const</span> QStringList &amp; relation = QStringList(), QSqlDatabase * pDatabase = NULL) = 0;
<a name="l00155"></a>00155 
<a name="l00166"></a>00166    <span class="keyword">virtual</span> QSqlError qxInsert(<span class="keyword">const</span> QStringList &amp; relation = QStringList(), QSqlDatabase * pDatabase = NULL) = 0;
<a name="l00167"></a>00167 
<a name="l00180"></a>00180    <span class="keyword">virtual</span> QSqlError qxUpdate(<span class="keyword">const</span> <a class="code" href="classqx_1_1_qx_sql_query.html" title="qx::QxSqlQuery : define a user SQL query added to default SQL query builded by QxOrm library...">qx::QxSqlQuery</a> &amp; query = <a class="code" href="classqx_1_1_qx_sql_query.html" title="qx::QxSqlQuery : define a user SQL query added to default SQL query builded by QxOrm library...">qx::QxSqlQuery</a>(), <span class="keyword">const</span> QStringList &amp; columns = QStringList(), <span class="keyword">const</span> QStringList &amp; relation = QStringList(), QSqlDatabase * pDatabase = NULL) = 0;
<a name="l00181"></a>00181 
<a name="l00194"></a>00194    <span class="keyword">virtual</span> QSqlError qxSave(<span class="keyword">const</span> QStringList &amp; relation = QStringList(), QSqlDatabase * pDatabase = NULL) = 0;
<a name="l00195"></a>00195 
<a name="l00209"></a>00209    <span class="keyword">virtual</span> QSqlError qxDeleteById(<span class="keyword">const</span> QVariant &amp; <span class="keywordtype">id</span> = QVariant(), QSqlDatabase * pDatabase = NULL) = 0;
<a name="l00210"></a>00210 
<a name="l00223"></a>00223    <span class="keyword">virtual</span> QSqlError qxDeleteAll(QSqlDatabase * pDatabase = NULL) = 0;
<a name="l00224"></a>00224 
<a name="l00238"></a>00238    <span class="keyword">virtual</span> QSqlError qxDeleteByQuery(<span class="keyword">const</span> <a class="code" href="classqx_1_1_qx_sql_query.html" title="qx::QxSqlQuery : define a user SQL query added to default SQL query builded by QxOrm library...">qx::QxSqlQuery</a> &amp; query, QSqlDatabase * pDatabase = NULL) = 0;
<a name="l00239"></a>00239 
<a name="l00250"></a>00250    <span class="keyword">virtual</span> QSqlError qxDestroyById(<span class="keyword">const</span> QVariant &amp; <span class="keywordtype">id</span> = QVariant(), QSqlDatabase * pDatabase = NULL) = 0;
<a name="l00251"></a>00251 
<a name="l00261"></a>00261    <span class="keyword">virtual</span> QSqlError qxDestroyAll(QSqlDatabase * pDatabase = NULL) = 0;
<a name="l00262"></a>00262 
<a name="l00273"></a>00273    <span class="keyword">virtual</span> QSqlError qxDestroyByQuery(<span class="keyword">const</span> <a class="code" href="classqx_1_1_qx_sql_query.html" title="qx::QxSqlQuery : define a user SQL query added to default SQL query builded by QxOrm library...">qx::QxSqlQuery</a> &amp; query, QSqlDatabase * pDatabase = NULL) = 0;
<a name="l00274"></a>00274 
<a name="l00281"></a>00281    <span class="keyword">virtual</span> QSqlError qxExecuteQuery(<a class="code" href="classqx_1_1_qx_sql_query.html" title="qx::QxSqlQuery : define a user SQL query added to default SQL query builded by QxOrm library...">qx::QxSqlQuery</a> &amp; query, QSqlDatabase * pDatabase = NULL) = 0;
<a name="l00282"></a>00282 
<a name="l00290"></a>00290    <span class="keyword">virtual</span> QSqlError qxExecuteQuery(<a class="code" href="classqx_1_1_qx_sql_query.html" title="qx::QxSqlQuery : define a user SQL query added to default SQL query builded by QxOrm library...">qx::QxSqlQuery</a> &amp; query, <a class="code" href="classqx_1_1_ix_collection.html" title="qx::IxCollection : common interface for all QxOrm containers qx::QxCollection&lt;Key, Value&gt;">qx::IxCollection</a> &amp; list, QSqlDatabase * pDatabase = NULL) = 0;
<a name="l00291"></a>00291 
<a name="l00302"></a>00302    <span class="keyword">virtual</span> <a class="code" href="classqx_1_1_qx_bool.html" title="qx_bool : boolean type with code and description message when an error occured">qx_bool</a> qxExist(<span class="keyword">const</span> QVariant &amp; <span class="keywordtype">id</span> = QVariant(), QSqlDatabase * pDatabase = NULL) = 0;
<a name="l00303"></a>00303 
<a name="l00311"></a>00311    <span class="keyword">virtual</span> <a class="code" href="classqx_1_1_qx_invalid_value_x.html" title="qx::QxInvalidValueX : list of invalid values">qx::QxInvalidValueX</a> qxValidate(<span class="keyword">const</span> QStringList &amp; groups = QStringList()) = 0;
<a name="l00312"></a>00312 
<a name="l00317"></a>00317    <span class="keyword">virtual</span> <a class="code" href="namespaceqx.html#a8792a6513f37c4a4ba24a55dbabee03b">qx::IxCollection_ptr</a> qxNewPersistableCollection() <span class="keyword">const</span> = 0;
<a name="l00318"></a>00318 
<a name="l00323"></a>00323    <span class="keyword">virtual</span> <a class="code" href="classqx_1_1_ix_class.html" title="qx::IxClass : common interface for all classes registered into QxOrm context">qx::IxClass</a> * qxClass() <span class="keyword">const</span> = 0;
<a name="l00324"></a>00324 
<a name="l00325"></a>00325 <span class="keyword">public</span>:
<a name="l00326"></a>00326 
<a name="l00327"></a>00327    <span class="keyword">static</span> <a class="code" href="namespaceqx.html#a8792a6513f37c4a4ba24a55dbabee03b">qx::IxCollection_ptr</a> qxFetchAll(<span class="keyword">const</span> QString &amp; className, <span class="keyword">const</span> QStringList &amp; columns = QStringList(), <span class="keyword">const</span> QStringList &amp; relation = QStringList(), QSqlDatabase * pDatabase = NULL);
<a name="l00328"></a>00328    <span class="keyword">static</span> <a class="code" href="namespaceqx.html#a8792a6513f37c4a4ba24a55dbabee03b">qx::IxCollection_ptr</a> qxFetchByQuery(<span class="keyword">const</span> QString &amp; className, <span class="keyword">const</span> <a class="code" href="classqx_1_1_qx_sql_query.html" title="qx::QxSqlQuery : define a user SQL query added to default SQL query builded by QxOrm library...">qx::QxSqlQuery</a> &amp; query, <span class="keyword">const</span> QStringList &amp; columns = QStringList(), <span class="keyword">const</span> QStringList &amp; relation = QStringList(), QSqlDatabase * pDatabase = NULL);
<a name="l00329"></a>00329    <span class="keyword">static</span> <a class="code" href="namespaceqx.html#a8792a6513f37c4a4ba24a55dbabee03b">qx::IxCollection_ptr</a> qxExecuteQuery(<span class="keyword">const</span> QString &amp; className, <a class="code" href="classqx_1_1_qx_sql_query.html" title="qx::QxSqlQuery : define a user SQL query added to default SQL query builded by QxOrm library...">qx::QxSqlQuery</a> &amp; query, QSqlDatabase * pDatabase = NULL);
<a name="l00330"></a>00330 
<a name="l00331"></a>00331 };
<a name="l00332"></a>00332 
<a name="l00333"></a><a class="code" href="namespaceqx.html#ac6a83a2493567738599e729098d0e1d5">00333</a> <span class="keyword">typedef</span> qx_shared_ptr&lt;qx::IxPersistable&gt; <a class="code" href="namespaceqx.html#ac6a83a2493567738599e729098d0e1d5">IxPersistable_ptr</a>;
<a name="l00334"></a>00334 
<a name="l00339"></a>00339 <span class="keyword">template</span> &lt;<span class="keyword">typename</span> T&gt;
<a name="l00340"></a><a class="code" href="classqx_1_1_ix_persistable_collection.html">00340</a> <span class="keyword">class </span><a class="code" href="classqx_1_1_ix_persistable_collection.html" title="qx::IxPersistableCollection&lt;T&gt;::type : return the collection type used by qx::IxPersistable interface...">IxPersistableCollection</a>
<a name="l00341"></a>00341 {
<a name="l00342"></a>00342 
<a name="l00343"></a>00343 <span class="keyword">private</span>:
<a name="l00344"></a>00344 
<a name="l00345"></a><a class="code" href="classqx_1_1_ix_persistable_collection.html#a10134763cae51be56e696aba65f0794d">00345</a>    <span class="keyword">typedef</span> <span class="keyword">typename</span> <a class="code" href="classqx_1_1trait_1_1get__primary__key.html#a11ae75af18e7cc688dd45e73c037dc39">qx::trait::get_primary_key&lt;T&gt;::type</a> <a class="code" href="classqx_1_1_ix_persistable_collection.html#a10134763cae51be56e696aba65f0794d">qx_type_primary_key</a>;
<a name="l00346"></a><a class="code" href="classqx_1_1_ix_persistable_collection.html#a60463c7d266f1d09def725086df9cbfc">00346</a>    <span class="keyword">typedef</span> qx_shared_ptr&lt;T&gt; <a class="code" href="classqx_1_1_ix_persistable_collection.html#a60463c7d266f1d09def725086df9cbfc">qx_type_ptr</a>;
<a name="l00347"></a>00347 
<a name="l00348"></a>00348 <span class="keyword">public</span>:
<a name="l00349"></a>00349 
<a name="l00350"></a><a class="code" href="classqx_1_1_ix_persistable_collection.html#a1d18f71fc2f7ef6587b246033e3322b5">00350</a>    <span class="keyword">typedef</span> <a class="code" href="classqx_1_1_qx_collection.html" title="qx::QxCollection&lt;Key, Value&gt; : QxOrm container (keep insertion order + quick access by index + quick ...">qx::QxCollection&lt;qx_type_primary_key, qx_type_ptr&gt;</a> <a class="code" href="classqx_1_1_ix_persistable_collection.html#a1d18f71fc2f7ef6587b246033e3322b5">type</a>;
<a name="l00351"></a>00351 
<a name="l00352"></a>00352 };
<a name="l00353"></a>00353 
<a name="l00354"></a>00354 } <span class="comment">// namespace qx</span>
<a name="l00355"></a>00355 
<a name="l00356"></a>00356 <span class="keyword">namespace </span>qx {
<a name="l00357"></a>00357 <span class="keyword">namespace </span>trait {
<a name="l00358"></a>00358 
<a name="l00363"></a>00363 <span class="keyword">template</span> &lt;<span class="keyword">typename</span> T&gt;
<a name="l00364"></a><a class="code" href="structqx_1_1trait_1_1is__ix__persistable.html">00364</a> <span class="keyword">struct </span><a class="code" href="structqx_1_1trait_1_1is__ix__persistable.html" title="qx::trait::is_ix_persistable&lt;T&gt;::value : return true if T implements qx::IxPersistable interface...">is_ix_persistable</a>
<a name="l00365"></a><a class="code" href="structqx_1_1trait_1_1is__ix__persistable.html#aec9cf11cbac687c03b339952dcd4af8ead0fd297bf610eb633e2209390a357d82">00365</a> { <span class="keyword">enum</span> { <a class="code" href="structqx_1_1trait_1_1is__ix__persistable.html#aec9cf11cbac687c03b339952dcd4af8ead0fd297bf610eb633e2209390a357d82">value</a> = boost::is_base_of&lt;qx::IxPersistable, T&gt;::value }; };
<a name="l00366"></a>00366 
<a name="l00367"></a>00367 } <span class="comment">// namespace trait</span>
<a name="l00368"></a>00368 } <span class="comment">// namespace qx</span>
<a name="l00369"></a>00369 
<a name="l00370"></a><a class="code" href="_ix_persistable_8h.html#a311d8fc0e6c4fc1c42e43a54f2dc44da">00370</a> <span class="preprocessor">#define QX_PERSISTABLE_HPP(className) \</span>
<a name="l00371"></a>00371 <span class="preprocessor">public: \</span>
<a name="l00372"></a>00372 <span class="preprocessor">virtual long qxCount(const qx::QxSqlQuery &amp; query = qx::QxSqlQuery(), QSqlDatabase * pDatabase = NULL); \</span>
<a name="l00373"></a>00373 <span class="preprocessor">virtual QSqlError qxCount(long &amp; lCount, const qx::QxSqlQuery &amp; query = qx::QxSqlQuery(), QSqlDatabase * pDatabase = NULL); \</span>
<a name="l00374"></a>00374 <span class="preprocessor">virtual QSqlError qxFetchById(const QVariant &amp; id = QVariant(), const QStringList &amp; columns = QStringList(), const QStringList &amp; relation = QStringList(), QSqlDatabase * pDatabase = NULL); \</span>
<a name="l00375"></a>00375 <span class="preprocessor">virtual QSqlError qxFetchAll(qx::IxCollection &amp; list, const QStringList &amp; columns = QStringList(), const QStringList &amp; relation = QStringList(), QSqlDatabase * pDatabase = NULL); \</span>
<a name="l00376"></a>00376 <span class="preprocessor">virtual QSqlError qxFetchByQuery(const qx::QxSqlQuery &amp; query, qx::IxCollection &amp; list, const QStringList &amp; columns = QStringList(), const QStringList &amp; relation = QStringList(), QSqlDatabase * pDatabase = NULL); \</span>
<a name="l00377"></a>00377 <span class="preprocessor">virtual QSqlError qxInsert(const QStringList &amp; relation = QStringList(), QSqlDatabase * pDatabase = NULL); \</span>
<a name="l00378"></a>00378 <span class="preprocessor">virtual QSqlError qxUpdate(const qx::QxSqlQuery &amp; query = qx::QxSqlQuery(), const QStringList &amp; columns = QStringList(), const QStringList &amp; relation = QStringList(), QSqlDatabase * pDatabase = NULL); \</span>
<a name="l00379"></a>00379 <span class="preprocessor">virtual QSqlError qxSave(const QStringList &amp; relation = QStringList(), QSqlDatabase * pDatabase = NULL); \</span>
<a name="l00380"></a>00380 <span class="preprocessor">virtual QSqlError qxDeleteById(const QVariant &amp; id = QVariant(), QSqlDatabase * pDatabase = NULL); \</span>
<a name="l00381"></a>00381 <span class="preprocessor">virtual QSqlError qxDeleteAll(QSqlDatabase * pDatabase = NULL); \</span>
<a name="l00382"></a>00382 <span class="preprocessor">virtual QSqlError qxDeleteByQuery(const qx::QxSqlQuery &amp; query, QSqlDatabase * pDatabase = NULL); \</span>
<a name="l00383"></a>00383 <span class="preprocessor">virtual QSqlError qxDestroyById(const QVariant &amp; id = QVariant(), QSqlDatabase * pDatabase = NULL); \</span>
<a name="l00384"></a>00384 <span class="preprocessor">virtual QSqlError qxDestroyAll(QSqlDatabase * pDatabase = NULL); \</span>
<a name="l00385"></a>00385 <span class="preprocessor">virtual QSqlError qxDestroyByQuery(const qx::QxSqlQuery &amp; query, QSqlDatabase * pDatabase = NULL); \</span>
<a name="l00386"></a>00386 <span class="preprocessor">virtual QSqlError qxExecuteQuery(qx::QxSqlQuery &amp; query, QSqlDatabase * pDatabase = NULL); \</span>
<a name="l00387"></a>00387 <span class="preprocessor">virtual QSqlError qxExecuteQuery(qx::QxSqlQuery &amp; query, qx::IxCollection &amp; list, QSqlDatabase * pDatabase = NULL); \</span>
<a name="l00388"></a>00388 <span class="preprocessor">virtual qx_bool qxExist(const QVariant &amp; id = QVariant(), QSqlDatabase * pDatabase = NULL); \</span>
<a name="l00389"></a>00389 <span class="preprocessor">virtual qx::QxInvalidValueX qxValidate(const QStringList &amp; groups = QStringList()); \</span>
<a name="l00390"></a>00390 <span class="preprocessor">virtual qx::IxCollection_ptr qxNewPersistableCollection() const; \</span>
<a name="l00391"></a>00391 <span class="preprocessor">virtual qx::IxClass * qxClass() const;</span>
<a name="l00392"></a>00392 <span class="preprocessor"></span>
<a name="l00393"></a>00393 <span class="preprocessor">#ifdef _QX_NO_RTTI</span>
<a name="l00394"></a>00394 <span class="preprocessor"></span><span class="preprocessor">#define QX_PERSISTABLE_CAST_COLLECTION(className) \</span>
<a name="l00395"></a>00395 <span class="preprocessor">qx::IxPersistableCollection&lt; className &gt;::type * list_typed = static_cast&lt; qx::IxPersistableCollection&lt; className &gt;::type * &gt;(&amp; list);</span>
<a name="l00396"></a>00396 <span class="preprocessor"></span><span class="preprocessor">#else // _QX_NO_RTTI</span>
<a name="l00397"></a><a class="code" href="_ix_persistable_8h.html#a8c3ef6ee33760bdb4e65f2c34bdafbfd">00397</a> <span class="preprocessor"></span><span class="preprocessor">#define QX_PERSISTABLE_CAST_COLLECTION(className) \</span>
<a name="l00398"></a>00398 <span class="preprocessor">qx::IxPersistableCollection&lt; className &gt;::type * list_typed = dynamic_cast&lt; qx::IxPersistableCollection&lt; className &gt;::type * &gt;(&amp; list);</span>
<a name="l00399"></a>00399 <span class="preprocessor"></span><span class="preprocessor">#endif // _QX_NO_RTTI</span>
<a name="l00400"></a>00400 <span class="preprocessor"></span>
<a name="l00401"></a><a class="code" href="_ix_persistable_8h.html#a8c17d818d8f1dbf25636a9d0ed2f96bd">00401</a> <span class="preprocessor">#define QX_PERSISTABLE_CPP(className) \</span>
<a name="l00402"></a>00402 <span class="preprocessor">\</span>
<a name="l00403"></a>00403 <span class="preprocessor">long className::qxCount(const qx::QxSqlQuery &amp; query, QSqlDatabase * pDatabase) \</span>
<a name="l00404"></a>00404 <span class="preprocessor">{ \</span>
<a name="l00405"></a>00405 <span class="preprocessor">   return qx::dao::count&lt; className &gt;(query, pDatabase); \</span>
<a name="l00406"></a>00406 <span class="preprocessor">} \</span>
<a name="l00407"></a>00407 <span class="preprocessor">\</span>
<a name="l00408"></a>00408 <span class="preprocessor">QSqlError className::qxCount(long &amp; lCount, const qx::QxSqlQuery &amp; query, QSqlDatabase * pDatabase) \</span>
<a name="l00409"></a>00409 <span class="preprocessor">{ \</span>
<a name="l00410"></a>00410 <span class="preprocessor">   return qx::dao::count&lt; className &gt;(lCount, query, pDatabase); \</span>
<a name="l00411"></a>00411 <span class="preprocessor">} \</span>
<a name="l00412"></a>00412 <span class="preprocessor">\</span>
<a name="l00413"></a>00413 <span class="preprocessor">QSqlError className::qxFetchById(const QVariant &amp; id, const QStringList &amp; columns, const QStringList &amp; relation, QSqlDatabase * pDatabase) \</span>
<a name="l00414"></a>00414 <span class="preprocessor">{ \</span>
<a name="l00415"></a>00415 <span class="preprocessor">   if (id.isValid()) \</span>
<a name="l00416"></a>00416 <span class="preprocessor">   { \</span>
<a name="l00417"></a>00417 <span class="preprocessor">      qx::IxDataMemberX * pDataMemberX = qx::QxClass&lt; className &gt;::getSingleton()-&gt;getDataMemberX(); \</span>
<a name="l00418"></a>00418 <span class="preprocessor">      qx::IxDataMember * pDataMemberId = (pDataMemberX ? pDataMemberX-&gt;getId_WithDaoStrategy() : NULL); \</span>
<a name="l00419"></a>00419 <span class="preprocessor">      if (! pDataMemberId) { qDebug(&quot;[QxOrm] problem with &#39;qxFetchById()&#39; method : &#39;%s&#39;&quot;, &quot;data member id not registered&quot;); qAssert(false); } \</span>
<a name="l00420"></a>00420 <span class="preprocessor">      if (! pDataMemberId) { return QSqlError(&quot;[QxOrm] problem with &#39;qxFetchById()&#39; method : &#39;data member id not registered&#39;&quot;, &quot;&quot;, QSqlError::UnknownError); } \</span>
<a name="l00421"></a>00421 <span class="preprocessor">      pDataMemberId-&gt;fromVariant(this, id, -1, qx::cvt::context::e_database); \</span>
<a name="l00422"></a>00422 <span class="preprocessor">   } \</span>
<a name="l00423"></a>00423 <span class="preprocessor">   QSqlError err; \</span>
<a name="l00424"></a>00424 <span class="preprocessor">   if (relation.count() == 0) { err = qx::dao::fetch_by_id((* this), pDatabase, columns); } \</span>
<a name="l00425"></a>00425 <span class="preprocessor">   else { err = qx::dao::fetch_by_id_with_relation(relation, (* this), pDatabase); } \</span>
<a name="l00426"></a>00426 <span class="preprocessor">   return err; \</span>
<a name="l00427"></a>00427 <span class="preprocessor">} \</span>
<a name="l00428"></a>00428 <span class="preprocessor">\</span>
<a name="l00429"></a>00429 <span class="preprocessor">QSqlError className::qxFetchAll(qx::IxCollection &amp; list, const QStringList &amp; columns, const QStringList &amp; relation, QSqlDatabase * pDatabase) \</span>
<a name="l00430"></a>00430 <span class="preprocessor">{ \</span>
<a name="l00431"></a>00431 <span class="preprocessor">   QX_PERSISTABLE_CAST_COLLECTION(className) \</span>
<a name="l00432"></a>00432 <span class="preprocessor">   if (! list_typed) { qDebug(&quot;[QxOrm] problem with &#39;qxFetchAll()&#39; method : &#39;%s&#39;&quot;, &quot;dynamic_cast failed using collection qx::QxCollection&lt; type_primary_key, qx_shared_ptr&lt;type&gt; &gt;&quot;); qAssert(false); } \</span>
<a name="l00433"></a>00433 <span class="preprocessor">   if (! list_typed) { return QSqlError(&quot;[QxOrm] problem with &#39;qxFetchAll()&#39; method : &#39;dynamic_cast failed using collection qx::QxCollection&lt; type_primary_key, qx_shared_ptr&lt;type&gt; &gt;&#39;&quot;, &quot;&quot;, QSqlError::UnknownError); } \</span>
<a name="l00434"></a>00434 <span class="preprocessor">   QSqlError err; \</span>
<a name="l00435"></a>00435 <span class="preprocessor">   if (relation.count() == 0) { err = qx::dao::fetch_all((* list_typed), pDatabase, columns); } \</span>
<a name="l00436"></a>00436 <span class="preprocessor">   else { err = qx::dao::fetch_all_with_relation(relation, (* list_typed), pDatabase); } \</span>
<a name="l00437"></a>00437 <span class="preprocessor">   return err; \</span>
<a name="l00438"></a>00438 <span class="preprocessor">} \</span>
<a name="l00439"></a>00439 <span class="preprocessor">\</span>
<a name="l00440"></a>00440 <span class="preprocessor">QSqlError className::qxFetchByQuery(const qx::QxSqlQuery &amp; query, qx::IxCollection &amp; list, const QStringList &amp; columns, const QStringList &amp; relation, QSqlDatabase * pDatabase) \</span>
<a name="l00441"></a>00441 <span class="preprocessor">{ \</span>
<a name="l00442"></a>00442 <span class="preprocessor">   QX_PERSISTABLE_CAST_COLLECTION(className) \</span>
<a name="l00443"></a>00443 <span class="preprocessor">   if (! list_typed) { qDebug(&quot;[QxOrm] problem with &#39;qxFetchByQuery()&#39; method : &#39;%s&#39;&quot;, &quot;dynamic_cast failed using collection qx::QxCollection&lt; type_primary_key, qx_shared_ptr&lt;type&gt; &gt;&quot;); qAssert(false); } \</span>
<a name="l00444"></a>00444 <span class="preprocessor">   if (! list_typed) { return QSqlError(&quot;[QxOrm] problem with &#39;qxFetchByQuery()&#39; method : &#39;dynamic_cast failed using collection qx::QxCollection&lt; type_primary_key, qx_shared_ptr&lt;type&gt; &gt;&#39;&quot;, &quot;&quot;, QSqlError::UnknownError); } \</span>
<a name="l00445"></a>00445 <span class="preprocessor">   QSqlError err; \</span>
<a name="l00446"></a>00446 <span class="preprocessor">   if (relation.count() == 0) { err = qx::dao::fetch_by_query(query, (* list_typed), pDatabase, columns); } \</span>
<a name="l00447"></a>00447 <span class="preprocessor">   else { err = qx::dao::fetch_by_query_with_relation(relation, query, (* list_typed), pDatabase); } \</span>
<a name="l00448"></a>00448 <span class="preprocessor">   return err; \</span>
<a name="l00449"></a>00449 <span class="preprocessor">} \</span>
<a name="l00450"></a>00450 <span class="preprocessor">\</span>
<a name="l00451"></a>00451 <span class="preprocessor">QSqlError className::qxInsert(const QStringList &amp; relation, QSqlDatabase * pDatabase) \</span>
<a name="l00452"></a>00452 <span class="preprocessor">{ \</span>
<a name="l00453"></a>00453 <span class="preprocessor">   QSqlError err; \</span>
<a name="l00454"></a>00454 <span class="preprocessor">   if (relation.count() == 0) { err = qx::dao::insert((* this), pDatabase); } \</span>
<a name="l00455"></a>00455 <span class="preprocessor">   else { err = qx::dao::insert_with_relation(relation, (* this), pDatabase); } \</span>
<a name="l00456"></a>00456 <span class="preprocessor">   return err; \</span>
<a name="l00457"></a>00457 <span class="preprocessor">} \</span>
<a name="l00458"></a>00458 <span class="preprocessor">\</span>
<a name="l00459"></a>00459 <span class="preprocessor">QSqlError className::qxUpdate(const qx::QxSqlQuery &amp; query, const QStringList &amp; columns, const QStringList &amp; relation, QSqlDatabase * pDatabase) \</span>
<a name="l00460"></a>00460 <span class="preprocessor">{ \</span>
<a name="l00461"></a>00461 <span class="preprocessor">   QSqlError err; \</span>
<a name="l00462"></a>00462 <span class="preprocessor">   if (relation.count() == 0) { err = qx::dao::update_by_query(query, (* this), pDatabase, columns); } \</span>
<a name="l00463"></a>00463 <span class="preprocessor">   else { err = qx::dao::update_by_query_with_relation(relation, query, (* this), pDatabase); } \</span>
<a name="l00464"></a>00464 <span class="preprocessor">   return err; \</span>
<a name="l00465"></a>00465 <span class="preprocessor">} \</span>
<a name="l00466"></a>00466 <span class="preprocessor">\</span>
<a name="l00467"></a>00467 <span class="preprocessor">QSqlError className::qxSave(const QStringList &amp; relation, QSqlDatabase * pDatabase) \</span>
<a name="l00468"></a>00468 <span class="preprocessor">{ \</span>
<a name="l00469"></a>00469 <span class="preprocessor">   QSqlError err; \</span>
<a name="l00470"></a>00470 <span class="preprocessor">   if (relation.count() == 0) { err = qx::dao::save((* this), pDatabase); } \</span>
<a name="l00471"></a>00471 <span class="preprocessor">   else { err = qx::dao::save_with_relation(relation, (* this), pDatabase); } \</span>
<a name="l00472"></a>00472 <span class="preprocessor">   return err; \</span>
<a name="l00473"></a>00473 <span class="preprocessor">} \</span>
<a name="l00474"></a>00474 <span class="preprocessor">\</span>
<a name="l00475"></a>00475 <span class="preprocessor">QSqlError className::qxDeleteById(const QVariant &amp; id, QSqlDatabase * pDatabase) \</span>
<a name="l00476"></a>00476 <span class="preprocessor">{ \</span>
<a name="l00477"></a>00477 <span class="preprocessor">   if (id.isValid()) \</span>
<a name="l00478"></a>00478 <span class="preprocessor">   { \</span>
<a name="l00479"></a>00479 <span class="preprocessor">      qx::IxDataMemberX * pDataMemberX = qx::QxClass&lt; className &gt;::getSingleton()-&gt;getDataMemberX(); \</span>
<a name="l00480"></a>00480 <span class="preprocessor">      qx::IxDataMember * pDataMemberId = (pDataMemberX ? pDataMemberX-&gt;getId_WithDaoStrategy() : NULL); \</span>
<a name="l00481"></a>00481 <span class="preprocessor">      if (! pDataMemberId) { qDebug(&quot;[QxOrm] problem with &#39;qxDeleteById()&#39; method : &#39;%s&#39;&quot;, &quot;data member id not registered&quot;); qAssert(false); } \</span>
<a name="l00482"></a>00482 <span class="preprocessor">      if (! pDataMemberId) { return QSqlError(&quot;[QxOrm] problem with &#39;qxDeleteById()&#39; method : &#39;data member id not registered&#39;&quot;, &quot;&quot;, QSqlError::UnknownError); } \</span>
<a name="l00483"></a>00483 <span class="preprocessor">      pDataMemberId-&gt;fromVariant(this, id, -1, qx::cvt::context::e_database); \</span>
<a name="l00484"></a>00484 <span class="preprocessor">   } \</span>
<a name="l00485"></a>00485 <span class="preprocessor">   return qx::dao::delete_by_id((* this), pDatabase); \</span>
<a name="l00486"></a>00486 <span class="preprocessor">} \</span>
<a name="l00487"></a>00487 <span class="preprocessor">\</span>
<a name="l00488"></a>00488 <span class="preprocessor">QSqlError className::qxDeleteAll(QSqlDatabase * pDatabase) \</span>
<a name="l00489"></a>00489 <span class="preprocessor">{ \</span>
<a name="l00490"></a>00490 <span class="preprocessor">   return qx::dao::delete_all&lt; className &gt;(pDatabase); \</span>
<a name="l00491"></a>00491 <span class="preprocessor">} \</span>
<a name="l00492"></a>00492 <span class="preprocessor">\</span>
<a name="l00493"></a>00493 <span class="preprocessor">QSqlError className::qxDeleteByQuery(const qx::QxSqlQuery &amp; query, QSqlDatabase * pDatabase) \</span>
<a name="l00494"></a>00494 <span class="preprocessor">{ \</span>
<a name="l00495"></a>00495 <span class="preprocessor">   return qx::dao::delete_by_query&lt; className &gt;(query, pDatabase); \</span>
<a name="l00496"></a>00496 <span class="preprocessor">} \</span>
<a name="l00497"></a>00497 <span class="preprocessor">\</span>
<a name="l00498"></a>00498 <span class="preprocessor">QSqlError className::qxDestroyById(const QVariant &amp; id, QSqlDatabase * pDatabase) \</span>
<a name="l00499"></a>00499 <span class="preprocessor">{ \</span>
<a name="l00500"></a>00500 <span class="preprocessor">   if (id.isValid()) \</span>
<a name="l00501"></a>00501 <span class="preprocessor">   { \</span>
<a name="l00502"></a>00502 <span class="preprocessor">      qx::IxDataMemberX * pDataMemberX = qx::QxClass&lt; className &gt;::getSingleton()-&gt;getDataMemberX(); \</span>
<a name="l00503"></a>00503 <span class="preprocessor">      qx::IxDataMember * pDataMemberId = (pDataMemberX ? pDataMemberX-&gt;getId_WithDaoStrategy() : NULL); \</span>
<a name="l00504"></a>00504 <span class="preprocessor">      if (! pDataMemberId) { qDebug(&quot;[QxOrm] problem with &#39;qxDestroyById()&#39; method : &#39;%s&#39;&quot;, &quot;data member id not registered&quot;); qAssert(false); } \</span>
<a name="l00505"></a>00505 <span class="preprocessor">      if (! pDataMemberId) { return QSqlError(&quot;[QxOrm] problem with &#39;qxDestroyById()&#39; method : &#39;data member id not registered&#39;&quot;, &quot;&quot;, QSqlError::UnknownError); } \</span>
<a name="l00506"></a>00506 <span class="preprocessor">      pDataMemberId-&gt;fromVariant(this, id, -1, qx::cvt::context::e_database); \</span>
<a name="l00507"></a>00507 <span class="preprocessor">   } \</span>
<a name="l00508"></a>00508 <span class="preprocessor">   return qx::dao::destroy_by_id((* this), pDatabase); \</span>
<a name="l00509"></a>00509 <span class="preprocessor">} \</span>
<a name="l00510"></a>00510 <span class="preprocessor">\</span>
<a name="l00511"></a>00511 <span class="preprocessor">QSqlError className::qxDestroyAll(QSqlDatabase * pDatabase) \</span>
<a name="l00512"></a>00512 <span class="preprocessor">{ \</span>
<a name="l00513"></a>00513 <span class="preprocessor">   return qx::dao::destroy_all&lt; className &gt;(pDatabase); \</span>
<a name="l00514"></a>00514 <span class="preprocessor">} \</span>
<a name="l00515"></a>00515 <span class="preprocessor">\</span>
<a name="l00516"></a>00516 <span class="preprocessor">QSqlError className::qxDestroyByQuery(const qx::QxSqlQuery &amp; query, QSqlDatabase * pDatabase) \</span>
<a name="l00517"></a>00517 <span class="preprocessor">{ \</span>
<a name="l00518"></a>00518 <span class="preprocessor">   return qx::dao::destroy_by_query&lt; className &gt;(query, pDatabase); \</span>
<a name="l00519"></a>00519 <span class="preprocessor">} \</span>
<a name="l00520"></a>00520 <span class="preprocessor">\</span>
<a name="l00521"></a>00521 <span class="preprocessor">QSqlError className::qxExecuteQuery(qx::QxSqlQuery &amp; query, QSqlDatabase * pDatabase) \</span>
<a name="l00522"></a>00522 <span class="preprocessor">{ \</span>
<a name="l00523"></a>00523 <span class="preprocessor">   return qx::dao::execute_query(query, (* this), pDatabase); \</span>
<a name="l00524"></a>00524 <span class="preprocessor">} \</span>
<a name="l00525"></a>00525 <span class="preprocessor">\</span>
<a name="l00526"></a>00526 <span class="preprocessor">QSqlError className::qxExecuteQuery(qx::QxSqlQuery &amp; query, qx::IxCollection &amp; list, QSqlDatabase * pDatabase) \</span>
<a name="l00527"></a>00527 <span class="preprocessor">{ \</span>
<a name="l00528"></a>00528 <span class="preprocessor">   QX_PERSISTABLE_CAST_COLLECTION(className) \</span>
<a name="l00529"></a>00529 <span class="preprocessor">   if (! list_typed) { qDebug(&quot;[QxOrm] problem with &#39;qxExecuteQuery()&#39; method : &#39;%s&#39;&quot;, &quot;dynamic_cast failed using collection qx::QxCollection&lt; type_primary_key, qx_shared_ptr&lt;type&gt; &gt;&quot;); qAssert(false); } \</span>
<a name="l00530"></a>00530 <span class="preprocessor">   if (! list_typed) { return QSqlError(&quot;[QxOrm] problem with &#39;qxExecuteQuery()&#39; method : &#39;dynamic_cast failed using collection qx::QxCollection&lt; type_primary_key, qx_shared_ptr&lt;type&gt; &gt;&#39;&quot;, &quot;&quot;, QSqlError::UnknownError); } \</span>
<a name="l00531"></a>00531 <span class="preprocessor">   return qx::dao::execute_query(query, (* list_typed), pDatabase); \</span>
<a name="l00532"></a>00532 <span class="preprocessor">} \</span>
<a name="l00533"></a>00533 <span class="preprocessor">\</span>
<a name="l00534"></a>00534 <span class="preprocessor">qx_bool className::qxExist(const QVariant &amp; id, QSqlDatabase * pDatabase) \</span>
<a name="l00535"></a>00535 <span class="preprocessor">{ \</span>
<a name="l00536"></a>00536 <span class="preprocessor">   if (id.isValid()) \</span>
<a name="l00537"></a>00537 <span class="preprocessor">   { \</span>
<a name="l00538"></a>00538 <span class="preprocessor">      qx::IxDataMemberX * pDataMemberX = qx::QxClass&lt; className &gt;::getSingleton()-&gt;getDataMemberX(); \</span>
<a name="l00539"></a>00539 <span class="preprocessor">      qx::IxDataMember * pDataMemberId = (pDataMemberX ? pDataMemberX-&gt;getId_WithDaoStrategy() : NULL); \</span>
<a name="l00540"></a>00540 <span class="preprocessor">      if (! pDataMemberId) { qDebug(&quot;[QxOrm] problem with &#39;qxExist()&#39; method : &#39;%s&#39;&quot;, &quot;data member id not registered&quot;); qAssert(false); } \</span>
<a name="l00541"></a>00541 <span class="preprocessor">      if (! pDataMemberId) { return qx_bool(false); } \</span>
<a name="l00542"></a>00542 <span class="preprocessor">      pDataMemberId-&gt;fromVariant(this, id, -1, qx::cvt::context::e_database); \</span>
<a name="l00543"></a>00543 <span class="preprocessor">   } \</span>
<a name="l00544"></a>00544 <span class="preprocessor">   return qx::dao::exist((* this), pDatabase); \</span>
<a name="l00545"></a>00545 <span class="preprocessor">} \</span>
<a name="l00546"></a>00546 <span class="preprocessor">\</span>
<a name="l00547"></a>00547 <span class="preprocessor">qx::QxInvalidValueX className::qxValidate(const QStringList &amp; groups) \</span>
<a name="l00548"></a>00548 <span class="preprocessor">{ \</span>
<a name="l00549"></a>00549 <span class="preprocessor">   return qx::validate((* this), groups); \</span>
<a name="l00550"></a>00550 <span class="preprocessor">} \</span>
<a name="l00551"></a>00551 <span class="preprocessor">\</span>
<a name="l00552"></a>00552 <span class="preprocessor">qx::IxCollection_ptr className::qxNewPersistableCollection() const \</span>
<a name="l00553"></a>00553 <span class="preprocessor">{ \</span>
<a name="l00554"></a>00554 <span class="preprocessor">   qx::IxCollection_ptr coll; \</span>
<a name="l00555"></a>00555 <span class="preprocessor">   coll.reset(new qx::IxPersistableCollection&lt; className &gt;::type()); \</span>
<a name="l00556"></a>00556 <span class="preprocessor">   return coll; \</span>
<a name="l00557"></a>00557 <span class="preprocessor">} \</span>
<a name="l00558"></a>00558 <span class="preprocessor">\</span>
<a name="l00559"></a>00559 <span class="preprocessor">qx::IxClass * className::qxClass() const \</span>
<a name="l00560"></a>00560 <span class="preprocessor">{ \</span>
<a name="l00561"></a>00561 <span class="preprocessor">   return qx::QxClass&lt; className &gt;::getSingleton(); \</span>
<a name="l00562"></a>00562 <span class="preprocessor">} \</span>
<a name="l00563"></a>00563 <span class="preprocessor"></span>
<a name="l00564"></a>00564 <span class="preprocessor"></span><span class="preprocessor">#endif // _IX_PERSISTABLE_H_</span>
</pre></div></div>
</div>
  <div id="nav-path" class="navpath">
    <ul>
      <li class="navelem"><a class="el" href="_ix_persistable_8h.html">IxPersistable.h</a>      </li>
<!-- window showing the filter options -->
<div id="MSearchSelectWindow"
     onmouseover="return searchBox.OnSearchSelectShow()"
     onmouseout="return searchBox.OnSearchSelectHide()"
     onkeydown="return searchBox.OnSearchSelectKey(event)">
<a class="SelectItem" href="javascript:void(0)" onclick="searchBox.OnSelectItem(0)"><span class="SelectionMark">&#160;</span>All</a><a class="SelectItem" href="javascript:void(0)" onclick="searchBox.OnSelectItem(1)"><span class="SelectionMark">&#160;</span>Classes</a><a class="SelectItem" href="javascript:void(0)" onclick="searchBox.OnSelectItem(2)"><span class="SelectionMark">&#160;</span>Namespaces</a><a class="SelectItem" href="javascript:void(0)" onclick="searchBox.OnSelectItem(3)"><span class="SelectionMark">&#160;</span>Files</a><a class="SelectItem" href="javascript:void(0)" onclick="searchBox.OnSelectItem(4)"><span class="SelectionMark">&#160;</span>Functions</a><a class="SelectItem" href="javascript:void(0)" onclick="searchBox.OnSelectItem(5)"><span class="SelectionMark">&#160;</span>Variables</a><a class="SelectItem" href="javascript:void(0)" onclick="searchBox.OnSelectItem(6)"><span class="SelectionMark">&#160;</span>Typedefs</a><a class="SelectItem" href="javascript:void(0)" onclick="searchBox.OnSelectItem(7)"><span class="SelectionMark">&#160;</span>Enumerations</a><a class="SelectItem" href="javascript:void(0)" onclick="searchBox.OnSelectItem(8)"><span class="SelectionMark">&#160;</span>Enumerator</a><a class="SelectItem" href="javascript:void(0)" onclick="searchBox.OnSelectItem(9)"><span class="SelectionMark">&#160;</span>Friends</a><a class="SelectItem" href="javascript:void(0)" onclick="searchBox.OnSelectItem(10)"><span class="SelectionMark">&#160;</span>Defines</a></div>

<!-- iframe showing the search results (closed by default) -->
<div id="MSearchResultsWindow">
<iframe src="javascript:void(0)" frameborder="0" 
        name="MSearchResults" id="MSearchResults">
</iframe>
</div>


    <li class="footer">Generated on Sun Dec 11 2016 13:41:03 for QxOrm by
    <a href="http://www.doxygen.org/index.html">
    <img class="footer" src="doxygen.png" alt="doxygen"/></a> 1.7.5.1 </li>
   </ul>
 </div>


</body>
</html>
